using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace commonV2.controls
{
    public partial class hwInfo : UserControl
    {
        public hwInfo()
        {
            InitializeComponent();
        }
        public HardwareInfo myHwInfo
        {
            get
            {
                HardwareInfo info = new HardwareInfo();
                info.CPU = cpuIdEd.Text.Trim();
                info.HardDrive = hdriveIdEd.Text.Trim();
                info.Mainboard = mainboardIdEd.Text.Trim();
                info.BIOS = biosIdEd.Text.Trim();
                info.NetworkMAC = nicMacEd.Text.Trim();
                return info;
            }
            set
            {
                cpuIdEd.Text = value.CPU;
                hdriveIdEd.Text = value.HardDrive;
                mainboardIdEd.Text = value.Mainboard;
                biosIdEd.Text = value.BIOS;
                nicMacEd.Text = value.NetworkMAC;
            }
        }
        public void LockEdit(bool stat)
        {
            cpuIdEd.ReadOnly = stat;
            mainboardIdEd.ReadOnly = stat;
            biosIdEd.ReadOnly = stat;
            hdriveIdEd.ReadOnly = stat;
            nicMacEd.ReadOnly = stat;
        }
        public void LoadHwInfo()
        {
            this.myHwInfo = HardwareLibs.GetHardwareInfo();
        }
    }
}
